package com.example.demo.mapper;


import com.example.demo.entity.Item;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ItemMapper {
    @Delete("delete from tb_item where id in (#{id})")
    boolean deleteByPrimaryKey(String id);

    int insert(Item record);

    @Insert("insert into tb_item (title,status)values(#{title},#{status})")
    boolean insertSelective(Item record);

    Item selectByPrimaryKey(Long id);

    @Update("update  tb_item set title=#{title},status=#{status} where id=#{id}")
    boolean updateByPrimaryKeySelective(Item record);

    int updateByPrimaryKey(Item record);

    @Select("select * from tb_item where title like concat('%',#{mohu},'%')")
    List<Item> findAll(String mohu);

    @Select("select * from tb_item where id=#{id}")
    Item updateDate(Long id);
}